package com.spe.visual.generator.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.spe.visual.generator.service.IGeneratorService;
import com.spe.visual.generator.vo.GeneratorVO;
import com.spe.visual.generator.vo.ProjectInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author limingliang
 * @date 2020/12/12 16:45
 */
@RestController
@RequestMapping("/generator")
public class GeneratorController {

    @Autowired
    IGeneratorService generatorService;

    @GetMapping("/subProject")
    public R getSubProject() {
        ProjectInfoVO projectInfoVO = generatorService.getSubProject();
        return R.ok(projectInfoVO);
    }

    @PostMapping("/code")
    public R generatorCode(@RequestBody GeneratorVO generatorVO) {
        generatorService.generatorCode(generatorVO);
        return R.ok(null);
    }

}
